package spec.maxiuying.jiecheng;

import java.util.Scanner;

public class jiecheng {
    public static  void main(String[] args) {

        int sum = 0;

        System.out.println("输入一个数字: ");

        Scanner in = new Scanner(System.in);

        String str = in.nextLine();

        int n = Integer.valueOf(str);

        for (int i = 1; i <= n; i++)

            sum += i;

        System.out.println("sum=" + sum);

    }

}

